package com.hongyue.job2;

import java.util.TreeSet;

public class Demo {
    public static void main(String[] args) {
        Student st = new Student("张三","男",20);
        Student st1 = new Student("李四","女",21);
        Student st2 = new Student("张三","男",20);
        Student st3 = new Student("王五","男",22);
        TreeSet<Student> s = new TreeSet<>();
        s.add(st);
        s.add(st1);
        s.add(st2);
        s.add(st3);
        for (Student student : s) {
            System.out.println("student = " + student);
        }
    }
}
